home *** CD-ROM | disk | FTP | other *** search
Text File | 1990-09-07 | 72.5 KB | 2,899 lines |
-
-
-
-
-
-
-
- T R U E B A S I C
-
- The Structured Language System For The Future
-
-
-
-
- INSTRUCTIONS
-
- COMMODORE AMIGA 512K VERSION 1
-
- PRINTED BY COL (NOVA U.K. 1988).
-
-
-
-
- CREDITS
- Amiga A500
- Pye Studiocolour TV
- Amstrad DMP2000 Printer
- Cumana External Drive
- Wordperfect V4.1
- Nescafe Coffee
- Benson & Hedges
-
-
-
-
-
-
- These instructions have been taken from the two manuals that
- come with the True BASIC program disk. All essential details have
- been included. For a clearer idea of how some of the commands
- operate please examine the demo basic programs on the system
- disk, as these have all been taken from the original manuals and
- were used to accompany the text.
-
-
-
-
-
-
-
-
-
-
-
- WRITING PROGRAMS
-
- The LET statement assignes values to variables. The values may be
- written as constants, variables, or expressions. Unlike some other
- BASICs, LET is a mandatory keyword in True BASIC.
- LET statements have the form:
-
- LET variable = expression
-
-
- The Print statement displays the results of a program on your
- screen. You can print constants, variables, and expressions.
- PRINT statements have the form:
-
- PRINT expression1, expression2
-
- The last statement in each True BASIC program must be an END
- statement. The END statement is simply:
-
- END
-
- Program Listing "MPG"
- LET miles = 320
- LET gallons = 14.3
- PRINT miles, gallons, miles/gallons
- END
-
- Constants are quantities whose values cannot change. Constants
- may be whole numbers or decimals. True BASIC does not allow
- commas or spaces inside constants.
-
-
- Variables are quantities whose values may change. Variable names
- may be up to 31 characters long. Names must begin with a letter,
- but subsequent characters can be letters, digits, or the underscore
- character.
-
-
- Expressions may be any combination of variables, constants, and
- operators. In True BASIC, multiplication and division have higher
- priority then addition and subtraction. Exponentiation has highest
- priority.
-
-
- MODIFYING PROGRAMS
-
-
- Choose Show Output from the Windows menu to activate the Output
- Window.
-
- You can scroll a line horizontally by clicking at the very end of
- that line, or by using the cursor keys.
-
- The Tab key moves the insertion point to the next word on thecurrent line. If there isn`t one, it moves underneath the next word
- on the previous line.
-
- You can select text by dragging, or you can select a word by
- double-clicking and an entire line by triple-clicking.
- You can delete selected text by choosing Cut from the Edit menu,
- by pressing Command-X, or by pressing backspace or del.
-
- An exclamation point signals the beginning of a comment in True
- BASIC. Comments can occupy whole lines, or they may be on the
- same line as an executable statement.
-
- The INPUT statement allows you to enter variables values from the
- keyboard while the program is running. INPUT statements have the
- form:
-
- INPUT variable1, variable2, ...
-
- True BASIC displays error messages in the bar at the bottom of the
- source window, and simultaneously moves the insertion point to the
- line which contains the error.
-
- The SAVE command saves your program on the disk under it`s
- current name. The SAVE AS command also saves your current
- program on the disk, but asks you to provide a new name for it.
-
- The UNSAVE command deletes a file from the disk. Give the
- UNSAVE command by choosing Unsave from the Project menu.
-
-
- ELEMENTARY STRINGS
-
- True BASIC uses "strings" to represent text and other items which
- do not necessarily have numeric values. A string constant is any
- sequence of characters enclosed in double quotes. The characters
- in the string may include numbers, letters, punctuation marks, or
- other special characters.
-
- String variables are names for string values. The names of string
- variables must end in a dollar sign ($) to distinguish them from
- numeric variable names.
-
- When a PRINT statement has more than one item on it, True BASIC
- uses print zones, or columns, 16 characters wide, if the items are
- separated by commas. If the items are separated by semicolons,
- True BASIC displays strings with no leading or trailing spaces, and
- numbers with a space on each side.
-
- INPUT statements can include a prompt, and can process more than
- one item. The formats are:
-
- INPUT variable
- INPUT variable1, variable2, ...
- INPUT PROMPT expression$: variable1, variable2, ...
- The command NEW tells True BASIC to clear the editing window
- (and memory) to make room for a new program.
-
-
- LINE INPUT statements allow you to enter any kind of reply, even
- nothing. They have the form:
-
- LINE INPUT variable$
-
-
- LOOPS AND PRINTERS
-
- The FOR-NEXT loop is a True BASIC structure that allows you to
- repeat a block of statements a specified number of times. The loop
- is governed by an index variable, whose value changes each time
- the loop is executed. The FOR statement defines the starting value
- and ending value of the index variable. The NEXT statement
- indicates the end of the loop structure.
-
- FOR variable = first TO last
- - - -
- - - - block of statements
- - - -
- NEXT variable
-
- If no step is given in the FOR statement, the index variable is
- incremented by one each time the loop is repeated. By including a
- step size in the FOR statement, you can choose other increments
- for the index variable.
-
- FOR variable = first TO last STEP size
- - - -
- - - - block of statements
- - - -
- NEXT variable
-
- Example Program
- ! Square roots.
- !
- PRINT "Number", "Square Root" ! Print labels
- PRINT ! Leave blank line
- FOR number = 0 to 1 step .1 ! Go from 0 to 1 in small steps
- PRINT number, Sqr(number) ! Print number and square root
- NEXT number
- END
-
- You can even make the value of the index variable decrease each
- time the loop is executed by specifying a negative step size.
-
- True BASIC has several built-in functions which take input values
- from the program that uses them and returns a single value to the
- program. The input values, and the value returned, may be either
- string or numeric.
-
- The block of statements within a loop may include any True BASIC
- statement, even another control structure.
-
- To use your printer, first open a channel to the printer. Then use
- this channel in PRINT statements.
-
- OPEN #expression: PRINTER
- PRINT #expression: expression, expression, ...
- PRINT #expression: expression; expression; ...
-
- Example Program
- ! Print pattern of x's.
- !
- FOR row = 1 to 6
-
- FOR xcount = 1 to row
- PRINT "x";
- NEXT xcount
-
- PRINT
- NEXT row
- END
-
-
-
-
- IF-THEN, RANDOMIZE AND STOP
-
- The IF-THEN structure allows you to modify the flow of control in
- a program by telling True BASIC to execute a statement or block
- of statements only if a condition is true. If only one statement is
- to be executed when the condition is true, you can write the entire
- IF-THEN structure on one line
-
- IF condition THEN statement
-
- IF-THEN structures use "comparisons" to make their decisions.
- Comaparisons chack values against other values by useing relational
- operators. True BASIC`s relational operators are:
-
- Operator Meaning
- = equal to
- <> or >< not equal to
- < less then
- <= or =< less than or equal to
- > greater than
- => or >= greater then or equel to
-
- These operators work on all combinations of constants, variables,
- and expressions.
-
- To execute more then one statement if the condition is true, you
- need to use a multiple-line IF-THEN structure. You must use an
- END IF statement to signal the end of the structure.
- IF condition THEN
- - - -
- - - - block of statements
- - - -
- END IF
-
- By using and ELSE statement, you can specify what actions to take
- if the condition is false.
-
- IF condition THEN statement1 ELSE statement2
-
- In a multiple-line structure, the ELSE statement must be on a line
- all by itself. The statements between the IF-THEN statement and
- the ELSE statement will be executed if the condition is true, and
- the statements between the ELSE statement and the END IF
- statement will be executed if the condition is false.
-
- IF condition THEN
- - - -
- - - - block of statements
- - - -
- ELSE
- - - -
- - - - block of statements
- - - -
- END IF
-
- The RANDOMIZE statement scrambles the sequence of random
- numbers returned by the Rnd function.
-
- The STOP statement stops a running program.
-
- Example Program
- ! Flip a coin five times.
- !
- FOR toss = 1 to 5
- IF Rnd<.5 then PRINT "Heads, you win"
- NEXT toss
-
- END
-
- Example Program
- ! Program to play a guessing game.
- !
- RANDOMIZE
- LET answer = Int(Rnd*6) + 1 ! Choose number from 1 to 6
-
- PRINT "I'm thinking of a number from 1 to 6."
- PRINT "You have 3 chances to guess it."
- PRINT
-
- FOR chance = 1 to 3
- PRINT "Enter your guess"; ! Ask for number
- INPUT guess
- IF guess = answer THEN
- PRINT "Correct!!!"
- STOP ! Stop here, you guessed it
- END IF
- NEXT chance
-
- PRINT
- PRINT "The number was"; answer
- END
-
-
- Example Program
- ! Program to play a guessing game.
- !
- RANDOMIZE
- LET answer = Int(Rnd*6) + 1 ! From 1 to 6
-
- PRINT "I'm thinking of a number from 1 to 6."
- PRINT "You have 3 chances to guess it."
- PRINT
-
- FOR chance = 1 TO 3
- PRINT "Enter your guess"; ! Ask for number
- INPUT guess ! Get a guess
-
- IF guess < 1 THEN ! Check it out
- PRINT "Must be at least 1."
- ELSE
- IF guess > 6 then
- PRINT "Can't be more than 6."
- ELSE
- IF guess < answer then
- PRINT "Too low."
- ELSE
- IF guess > answer then
- PRINT "Too high."
- ELSE ! Must be right
- PRINT "Correct!!!"
- STOP
- END IF
- END IF
- END IF
- END IF
- NEXT chance
-
- PRINT "The number was"; answer; "."
- END
-
-
-
-
-
-
-
- DO LOOPS
-
- A DO loop lets you execute blocks of statements repeatedly. DO
- loops differ from FOR-NEXT loops in that you don`t specify ahead
- of time just how many times the statements inside the loop will be
- repeated. Instead, the number of times depends on the result of
- logical comparisons made while the program is running.
-
- You can specify when the DO loop stops by a condition in either
- the DO statement at the beginning of the loop, the LOOP
- statement at the end of the loop, or both. You can specify that
- the loop will be repeated WHILE a certain condition remains true,
- or UNTIL a certain condition becomes true.
-
- DO UNTIL condition
- - - -
- - - - block of statements
- - - -
- LOOP
-
- DO WHILE condition
- - - -
- - - - block of statements
- - - -
- LOOP
-
- DO
- - - -
- - - - block of statements
- - - -
- LOOP UNTIL condition
-
- DO
- - - -
- - - - block of statements
- - - -
- LOOP WHILE condition
-
- The rules for conditions in DO loops are the same as in IF-THEN
- statements: you can use constants, variables, and expressions with
- relational operators.
-
- You can create combinations of conditions with the logical
- operators AND, OR, and NOT.
-
- Example Program
- ! Program to compute interest on a bank account.
- ! Stop when the money has doubled.
- !
- LET money = 10000 ! Start with $10,000
- LET original = money ! Remember original amount
-
- LET interest = 8.5/100 ! Interest is 8.5%
-
- DO until money >= 2 * original ! Loop until money doubles
-
- PRINT years, money ! Print year and money
- LET years = years + 1 ! Keep track of how long
- LET money = money + (interest * money) ! Add in interest
-
- LOOP
- PRINT "In"; years ; "years, you'll have $"; money
- END
-
-
- STORING DATA VALUES
-
- DATA statements store values that can be assigned to variables.
- Their format is:
-
- DATA item1, item2, ...
-
- READ statements assign data values to variables. Their format is:
-
- READ variable1, variable2, ...
-
- The variables in a READ statement may be numeric, string, or an
- assortment of the two. True BASIC will give you an error message
- if you try to read a non-numeric data value into a numeric
- variable, but will not if you read a number into a string variable.
-
- You can use True BASIC`s built-in conditions, MORE DATA and
- END DATA, in a DO loop to see whether there are any more data
- to be read.
-
- The RESTORE statement restores all your program`s data. The
- next READ statement will read the first item from the list of data
- statements.
-
- Example Program
- ! Trivia quiz.
- !
- READ num_quest ! Number of questions
-
- FOR i = 1 to num_quest ! Read all questions
-
- READ question$, answer$
-
- PRINT question$;
- LINE INPUT reply$ ! Get user's guess
-
- IF reply$ = answer$ THEN ! If correct...
- LET right = right + 1 ! Count right replies
- PRINT "Correct." ! And say bravo
- ELSE
- PRINT "No, the correct answer is "; answer$; "."
- END IF
-
- NEXT i
-
- PRINT "You got"; 100 * right/num_quest; "% right."
-
- DATA 5
-
- DATA What is the capital of Austria, Vienna
- DATA What year did Franklin Pierce take office, 1853
- DATA "What is the capital of Manitoba, Canada", Winnipeg
- DATA "How many years, on average, does a baboon live", 20
- DATA How about a gray squirrel, 5
-
- END
-
-
- INTRODUCTION TO GRAPHICS
-
- The PLOT statement draws points and lines on your screen. You
- describe the points in terms of coordinates, which are pairs of
- numbers. Each pair of numbers defines a particular location on the
- screen. PLOT statements have the forms:
-
- PLOT x,y
- PLOT x,y,;
- PLOT x1,y1; x2,y2; ...
-
- The first draws a single point. The semicolons in the second and
- third forms tell True BASIC to "leave the beam on" between points,
- thereby drawing lines.
-
- You can make a program stop at any time during its execution by
- choosing Stop from the Run menu, or pressing Command-period.
-
-
- The SET WINDOW statement lets you define the boundaries of your
- screen in terms of your own coordinates.
-
- SET WINDOW left, right, bottom, top
-
- Any points, lines, or text outside those boundaries won`t be visible.
-
- You can use the PLOT TEXT statement to add text to your graphic
- output:
-
- PLOT TEXT, AT x,y: "label"
-
- The CLEAR statement clears the output window (or full screen).
- It`s form is simply:
-
- CLEAR
-
- The PAUSE statement suspends program execution for a specified
- number of seconds:
-
- PAUSE seconds
-
- You can also "freeze" your program by choosing Pause from the
- Run Menu, or by pressing Command-W. A program suspended in
- this manner will resume as soon as you click or press a key.
-
- True BASIC normally uses radians when it calculates angles, sines,
- cosines, etc. To use degrees instead, add an OPTION statement to
- your program:
-
- OPTION ANGLE DEGREES
-
- The OPTION statement should precede any executable statement
- which would otherwise use radians.
-
- Example Program
- ! Plot random points.
- !
- DO
- LET x = Rnd ! Pick two random numbers
- LET y = Rnd
- PLOT x,y ! Plot a point there
- LOOP
-
- END
-
- Example program
- ! Plot number of cars sold from 1900 to 1980.
- !
- SET WINDOW 1900, 1980, 0, 10e6
-
- FOR year = 1900 to 1980 step 10 ! Years by decades
- READ cars ! Read number of cars
- PLOT year, cars; ! Plot to this point
- NEXT year
-
- ! Car production data.
-
- DATA 4190, 187e3, 2.2e6, 3.3e6, 4.4e6, 8.0e6, 7.8e6
- DATA 8.2e6, 8.0e6
- END
-
-
- Example Program
- ! Plot number of cars sold from 1900 to 1980.
- !
- SET WINDOW 1900, 1980, 0, 10e6
-
- FOR year = 1900 to 1980 step 10 ! Years by decades
- READ cars ! Read number of cars
- PLOT year, cars; ! Plot to this point
- NEXT year
- PLOT
-
- SET WINDOW 1900, 1980, 0, 250e6
- FOR year = 1900 to 1980 step 10 ! Years by decades
- READ pop ! Read population
- PLOT year, pop;
- NEXT year
-
- ! Car production data.
-
- DATA 4190, 187e3, 2.2e6, 3.3e6, 4.4e6, 8.0e6, 7.8e6
- DATA 8.2e6, 8.0e6
-
- ! Population data.
-
- DATA 76e6, 92e6, 105.7e6, 122.8e6, 131.7e6
- DATA 150.7e6, 179.3e6, 203.3e6, 226.5e6
- END
-
-
- Example Program
- ! Lissajous experiment
- !
- SET WINDOW -1, 1, -1, 1
- DO
- PRINT "X multiplier, Y multiplier";
- INPUT xmult, ymult
- CLEAR
-
- FOR i = 0 to 2*pi STEP pi/100 ! Draw the figure
- PLOT sin(xmult*i), cos(ymult*i);
- NEXT i
-
- PLOT ! Turn off the beam
- PAUSE 3 ! Wait 3 seconds
- CLEAR ! Then clear the screen
- LOOP
- END
-
- ADVANCED GRAPHICS
-
- True BASIC has a family of graphics statements, the BOX
- statement, which performs fast operations on rectangular areas of
- the screen:
-
- BOX AREA left, right, bottom, top
- BOX CIRCLE left, right, bottom, top
- or
- BOX ELLIPSE left, right, bottom, top
- BOX CLEAR left, right, bottom, top
- BOX KEEP left, right, bottom, top IN variable$
- BOX LINES left, right, bottom, top
- BOX SHOW variable$ AT left, bottom
- BOX SHOW variable$ AT left, bottom USING "and"
- BOX SHOW variable$ AT left, bottom USING "or"
- BOX SHOW variable$ AT left, bottom USING "xor"
- The SET COLOR statement sets the foreground colour for all
- graphic ouput. SET COLOR can be used with either a number or a
- name. The Workbench screen has three foreground colours which
- are controlled by the Preferences tool.
-
- The FLOOD statement fills a shape with the current colour. It`s
- form is:
-
- FLOOD x, y
-
- The SET BACK statement changes the background colour. It uses
- the same colours as SET COLOR.
-
- The SET COLOR MIX statement changes the shade of some colour
- number. You must specify the colour number to change, and the
- new settings for the red, green, and blue colour guns.
-
- The Amiga`s "HIGH 16" mode provides high-resolution, full screen
- graphics with 16 colours.
-
- Name Number in HIGH16 mode
- Backgound 0
- White 1
- Blue 2
- Red 3
- Yellow 4
- Black 5
- Green 6
- Cyan 7
- magenta 11
- Brown 13
-
- True BASIC lets you specify colours by name, as well as by
- number.
-
- True BASIC uses the GET POINT and GET MOUSE statements for
- graphic input:
-
- GET POINT x, y
- GET MOUSE x, y, state
-
- GET POINT returns the X- and Y-coordinates of the point where
- you click. GET MOUSE returns the current coordinates and state
- of the mouse. The mouse states are:
-
- Number State
- 0 Button up
- 1 Button down
- 2 Button clicked
- 3 Button released
-
- True BASIC uses channel numbers to identify a particular source
- for input of destination for output. For example, to specify a
- separate window for graphic output, you must first open a channelto that portion of your screen. This OPEN statement has the form:
-
- OPEN #expr: SCREEN left, right, bottom, top
-
- You may have as many as ten channels open at a time, but only
- one window is active. All output goes to the active window. To
- make a window active, use:
-
- WINDOW #expr
-
-
- Example Program
- ! Draw a box.
- !
- SET WINDOW -14, 14, -10, 10 ! 0,0 is center of window
-
- BOX LINES -5, 5, -5, 5 ! 5*2 is length of each side
-
- END
-
-
- Example Program
- ! Draw a circle picture.
- !
- PICTURE Circle(sides)
-
- FOR i = 0 to sides
- LET u = (i*2*Pi)/sides ! Find next angle
- PLOT Cos(u), Sin(u); ! Plot next segment
- NEXT i
- PLOT ! Turn off beam
-
- END PICTURE
-
- SET WINDOW -15, 15, -10, 10 ! Set the window
-
- FOR j = 1 to 30 ! Draw a bunch of circles
- DRAW Circle(j) with Scale(j/3) ! Bigger and better
- NEXT j
- END
-
-
- Example Program
- ! A bouncing ball.
- !
- SET WINDOW 0, 30, 0, 20
-
- LET delta = +1 ! +1 is up, -1 is down
- LET x = 15 ! Start in center
- LET y = 10
-
- BOX CIRCLE x, x+1, y, y+1 ! Show first ball
- FLOOD x+.5, y+.5 ! Fill in circle
- BOX KEEP x, x+1, y, y+1 in ball$ ! Remember that image
- DO
- BOX CLEAR x, x+2, y, y+2 ! Erase old ball
- LET y = y + delta ! Continue on course
- IF y < 1 OR y > 19 then LET delta = -delta
-
- BOX SHOW ball$ at x,y ! Draw new ball
- PAUSE .05 ! Not too fast
- LOOP
- END
-
-
- Example Program
- ! Program to illustrate use of "xor".
- !
- SET window 0, 10, 0, 10
- BOX AREA 0, 1.5, 0, 1.5 ! Draw a rectangle
- BOX KEEP 0, 1.5, 0, 1.5 in box$ ! and keep it
- BOX CLEAR 0, 1.5, 0, 1.5
-
- FOR i = 1 to 8 ! Show overlapping boxes
- BOX SHOW box$ at i, i using "xor"
- NEXT i
- END
-
-
- Example Program
- ! Show the Amiga's "HIGH16" mode.
- !
- SET mode "HIGH16"
- SET window 0, 16, 0, 1
-
- FOR x = 0 to 15
- SET color x
- BOX AREA x, x+1, 0, 1
- NEXT x
- END
-
-
- Example Program
- ! Draw circles and ellipses.
- !
- DO
- GET POINT x1, y1 ! Choose one point
- GET POINT x2, y2 ! Choose another point
- BOX CIRCLE x1, x2, y1, y2 ! Draw circle
- LOOP
- END
-
-
- MUSIC AND SOUND EFFECTS
-
- The PLAY statement lets you play simple melodies on your
- computer. You can specify the notes to be played, the length of
- each note, and the tempo of the music. PLAY statements have theform:
-
- PLAY music$
-
- The string expression in the PLAY statement consists of music
- codes. Some of True BASIC`s music codes are:
-
- Code Meaning
- A to G Play a note in current octave
- L n Set the length of subsequent notes
- ML Play music legato, or smoothly
- MN Play music normally
- MS Play music staccato, or briskly
- O n Set current octave. Middle C is the first not in
- octave 5
- R n or P Rest for length n
- T n Set the tempo
- # or + Sharp
- - Flat
- . Play dotted note
-
- The SOUND statement lets you use your computer`s speaker to
- produce sounds of specified frequency and duration:
-
- SOUND frequency, duration
-
- The frequency is measured in Hertz (cycles per second) and the
- duration in seconds.
-
-
- Example Program
- ! Plays the beginning of
- ! "On Top of Old Smoky".
- !
- DO while more data
-
- READ music$ ! Get the string representations
- PLAY music$ ! And play the notes
-
- LOOP
-
- DATA O4 L4 C C E G O5 L2 C. O4 A.
- DATA L4 A F G A L1 G
- DATA L4 C C E G L2 G. D.
- DATA L4 E F E D L2 C.
- END
-
-
- Example Program
- ! Imitate ringing of a telephone.
- !
- FOR ring = 1 to 8 ! Let ring 8 times
-
- FOR i = 1 to 30 ! Each ring = 30 alternations
- SOUND 600, .03 ! Freq 600 for .03 sec
- SOUND 1500, .03 ! Then 1500 for .03 sec
- NEXT i
-
- PAUSE 2
- NEXT ring
- END
-
- ADVANCED EDITING
-
- The Search menu has three commands for finding and changing
- words (or numbers, or parts thereof) in your program:
-
-
-
- The Search Menu
- Move to block... Move the insertion point to specified
- line
- Find... Locate and select specified text
- Change... Replace specified text with new text
-
- You can select lines to be deleted, copied, moved, or edited by
- dragging, by triple clicking, and by shift-clicking. Or you can use
- the F4 "Mark" key.
-
- The Edit menu has eight commands that let you delete, copy, move
- and otherwise edit a block of lines
-
- The Edit Menu
- Cut Delete selected block
- Copy Copy selected block onto clipboard
- Paste Insert contents of clipboard into program
- Keep... Discard all but selected block
- Include... Insert specified file into program
- Edit... Restrict editing to selected block
- Select... Select specified block
- Select all Select entire program
-
- You may select the lines before you chhose the command, or you
- can choose the command first and then type line numbers to
- specify the block.
-
- To move part of your program from one place to another, first use
- Cut, move the insertion point, and then use Paste.
-
- Your True BASIC system disk includes four programs that will
- change the appearance of your current program.
-
- The Format Menu
- Do Num Add line numbers
- Du Unnum Remove line numbers
- Do Renum Resequence line numbers
- Do Format Emphasize keywords and indent structures
- Do... Choose a Do program
- Line numbers are completely optional in True BASIC.
-
- Pressing the > key when lines are selected moves the selection one
- space to the right; pressing the < key moves it to the left.
-
- Choose Print from the Project menu to list your current program
- on a printer.
-
- Choose Show Command from the Windows menu to activate the
- Command window.
-
- The F2 key will move your insertion point to the command window.
- If you`re already on the command line, pressing F2 will copy the
- last thing you typed onto the command line. press the F1 key to
- return to the source window.
-
- You can use the command window to debug your program. To
- breakpoint a line, select it and choose Breakpoint from the Run
- menu. When True BASIC executes that line, it will halt your
- program. Use the caommand window to debug the program, then
- use the Continue command to resume your program.
-
- The Most frequently used editing commands have the following
- keyboard shortcuts (Command=right Amiga key):
-
- Name Shortcut
- Change Command-E
- Copy Command-C
- Cut Command-X
- Find Command-F
- Paste Command-P
- Print Command-L
-
- The editing keys are:
-
- Key Meaning
- F1 Move to source window
- F2 Move to command window
- F3 Overtype
- F4 Mark line
- F5 Move to start of file
- F6 Move to end of file
- F7 Undo changes to line
- F8 Delete word to left
- F9 Delete word to right
- F10 Delete line to right
- ESC Delete line to left
- Backspace Delete character to left
- Del Delete character to right
-
-
-
-
-
- ADVANCED DECISION STRUCTURES
-
- The IF-TEHN-ELSE IF structure allows more flexibility in branching
- than the simple IF-THEN-ELSE structure. It lets you create
- multiple branches based on any logical conditions:
-
- IF condition1 THEN
- - - -
- - - - block1
- - - -
- ELSE IF condition2 THEN
- - - -
- - - - block2
- - - -
- ELSE IF condition3 THEN
- - - -
- - - - block3
- - - -
- ELSE
- - - -
- - - - blockE
- - - -
- END IF
-
- The SELECT CASE structure provide another, often clearer, method
- of defining multiple branches. The form of the SELECT CASE
- structure is:
-
- SELECT CASE index
- CASE test1, test2, ...
- - - -
- - - - block of statements
- - - -
- CASE test3, test4, ...
- - - -
- - - - block of statements
- - - -
- CASE ELSE
- - - -
- - - - block of statements
- - - -
- END SELECT
-
- The tests in a CASE statement may have any of the following
- forms:
-
- constant
- IS operator constant
- constant TO constant
-
- The EXIT DO and EXIT FOR statements let you jump out from the
- middle of a loop, rather then executing all of the statements within
- the loop.
-
- Example Program
- ! Program to play a guessing game.
- !
- RANDOMIZE
- LET answer = Int(Rnd*6) + 1 ! From 1 to 6
-
- PRINT "I'm thinking of a number from 1 to 6."
- PRINT "You have 3 chances to guess it."
- PRINT
-
- FOR chance = 1 TO 3
- PRINT "Enter your guess"; ! Ask for number
- INPUT guess ! Get a guess
-
- IF guess < 1 THEN ! Check it out
- PRINT "Must be at least 1."
- ELSE
- IF guess > 6 then
- PRINT "Can't be more than 6."
- ELSE
- IF guess < answer then
- PRINT "Too low."
- ELSE
- IF guess > answer then
- PRINT "Too high."
- ELSE ! Must be right
- PRINT "Correct!!!"
- STOP
- END IF
- END IF
- END IF
- END IF
- NEXT chance
-
- PRINT "The number was"; answer; "."
- END
-
-
- Example Program
- ! Craps game.
- !
- RANDOMIZE
-
- FOR game = 1 to 10 ! Play 10 games
-
- LET die1 = Int(6*Rnd + 1) ! Roll 1 die
- LET die2 = Int(6*Rnd + 1) ! And the other
- LET dice = die1 + die2 ! Sum of two dice
-
- PRINT dice; ! Print this roll
-
- SELECT CASE dice ! Branch on roll
-
- CASE 2, 3, 12 ! dice = 2, 3, or 12
- PRINT "You lose"
-
- CASE 7, 11 ! dice = 7 or 11
- PRINT "You win"
-
- CASE ELSE ! Anything else
- LET point = dice ! Remember that roll
- DO
- LET die1 = Int(6*Rnd + 1) ! Roll again
- LET die2 = Int(6*Rnd + 1) ! Both dice
- LET dice = die1 + die2
- PRINT dice; ! Print this roll
- LOOP until dice = 7 or dice = point
-
- IF dice=point then PRINT "You win" else PRINT "You
- lose"
- END SELECT
-
- NEXT game
-
- END
-
- MODULAR PROGRAMMING
-
- Subroutines and functions both provide methods of segmenting your
- True BASIC programs. A function returns a single numeric or
- string value to the calling program. A subroutine does not return
- one single value, but can change the values of parameters which
- are passed to it by the calling program.
-
- A function may be defined by a single line DEF statement, or by a
- block of lines beginning with a DEF statement and ending with an
- END DEF statement.
-
- A subroutine definition begins with a SUB statement and end with
- and END SUB statement.
-
- subroutines may have parameters, or values passed to them by the
- calling program. Parameters may be for the purpose of input to
- the subroutine, or they may be variables whose values are changed
- by the subroutine.
-
- Functions may also have one or more parameters. These
- parameters are for input only, since the value of the function itself
- is the only value returned to the calling program.
-
- Subroutines and functions may be internal or external. Internal
- subroutines and functions are part of the main program, and come
- before the END statement, while external ones are outside the main
- program and after the END statement. The primary difference is
- that internal subroutines and functions share variables with the
- rest of the program, while external ones do not.
-
- External subroutines and functions can be organised into libraries -
- collections of routines which can be used by any program.
-
-
- ARRAYS
-
- Every array must be named in a DIM statement before it`s used in
- the program. The DIM statement defines the number of dimensions
- for the array and the maximum number of elements in each
- dimension.
-
- Each item in an array is called an element. You refer to specifc
- elements by subscripts, which represent the element`s position in
- the array. Subscripts must be enclosed in parentheses.
-
- The subscripts of an array may have any numbers for their upper
- and lower bounds. For example:
-
- DIM a(5), b(-2 TO 2), c(6 TO 10)
- dimensions three arrays, each of which has five elements.
-
- Arrays may have as many as 255 dimensions on the Amiga.
-
-
- Example Program
- ! Inventory for 5 items.
- !
- READ item1$, number1
- READ item2$, number2
- READ item3$, number3
- READ item4$, number4
- READ item5$, number5
-
- PRINT "You have these items:"
- PRINT item1$, item2$, item3$, item4$, item5$
- PRINT number1, number2, number3, number4, number5
-
- DATA hammers, 4, umbrellas, 2, wood stoves, 1
- DATA bags of salt, 4, pliers, 2
- END
-
-
- Example Program
- ! Draw histogram of projected expenses.
- !
- DIM expense(1980 to 1989) ! Bounds run from 1980 to 1989
-
- FOR i = 1980 to 1989 ! Run through those years
- READ expense(i) ! Read projected expense
- IF expense(i) > max_exp then LET max_exp = expense(i)
- NEXT i
-
- SET window 1980, 1990, 0, 1.1*max_exp ! Set window
-
- FOR i = 1980 to 1989 ! Run through years
- BOX AREA i, i+.5, 0, expense(i) ! Draw bars
- NEXT i
- DATA 4000,4500,7000,8700,8900,11400,11200,10100,9800,9900
- END
-
-
- Example Program
- ! State capital quiz.
- !
- RANDOMIZE
- DIM state$(50,2) ! 50 states, 2 items per state
-
- FOR i = 1 to 50
- READ state$(i,1) ! Read state name
- READ state$(i,2) ! And capital
- NEXT i
-
- FOR i = 1 TO 10 ! Ask 10 questions
-
- LET n = Int(50*Rnd) + 1 ! Pick a number between 1 and 50
- PRINT "The capital of "; state$(n,1); " is";
- LINE INPUT capital$ ! Get the reply
- IF Lcase$(capital$) = Lcase$(state$(n,2)) THEN ! Correct?
- PRINT "RIGHT!"
- ELSE
- PRINT "Nope, it's "; state$(n,2); "."
- END IF
-
- NEXT i
-
- DATA Alabama,Montgomery, Alaska, Juneau, Arizona,Phoenix
- DATA Arkansas,Little Rock, California,Sacramento
- DATA Colorado,Denver, Connecticut,Hartford, Delaware,Dover
- DATA Florida,Tallahassee, Georgia,Atlanta, Hawaii,Honolulu
- DATA Idaho,Boise, Illinois,Springfield, Indiana,Indianapolis
- DATA Iowa,Des Moines, Kansas,Topeka, Kentucky,Frankfort
- DATA Louisiana,Baton Rouge, Maine,Augusta, Maryland,Annapolis
- DATA Massachusetts,Boston, Michigan,Lansing
- DATA Minnesota,St. Paul, Mississippi,Jackson
- DATA Missouri,Jefferson City, Montana,Helena
- DATA Nebraska,Lincoln, Nevada,Carson City
- DATA New Hampshire,Concord, New Jersey,Trenton
- DATA New Mexico,Santa Fe, New York,Albany
- DATA North Carolina,Raleigh, North Dakota,Bismarck
- DATA Ohio,Columbus, Oklahoma,Oklahoma City, Oregon,Salem
- DATA Pennsylvania,Harrisburg, Rhode Island,Providence
- DATA South Carolina,Columbia, South Dakota,Pierre
- DATA Tennessee,Nashville, Texas,Austin, Utah,Salt Lake City
- DATA Vermont,Montpelier, Virginia,Richmond, Washington,Olympia
- DATA West Virginia,Charleston, Wisconsin,Madison
- DATA Wyoming,Cheyenne
- END
-
-
- THE MAT STATEMENTS
-
- The MAT statements provide the ability to work with entire arrays
- at once. Instead of creating a loop to work with each element of
- an array, you can use a single MAT statement.
-
- MAT READ corresponds to the simple READ statement, and reads
- values from DATA statements into one or more arrays:
-
- MAT READ array1, array2, ...
-
- The MAT PRINT statement prints the values of all the elements in
- an array. Commas and semicolons work hust as they do in the
- simple PRINT statements:
-
- MAT PRINT array1, array2, ...
- MAT PRINT array1; array 2; ...
-
- MAT INPUT and MAT LINE INPUT let you enter values for an
- entire array:
-
- MAT INPUT array1, array2, ...
- MAT LINE INPUT array1$, array2$, ...
- MAT INPUT array(?)
-
- The (?) subscript lets you input as many elements as you want.
- True BASIC will redimension the array to be just big enough to
- hold these elements.
-
- The MAT assigment statement lets you assign a single value to all
- variables in an array, or to assign one array to another:
-
- MAT array = constant
- MAT array1 = array2
-
- True BASIC`s matrix arithmetic lets you add, subtract, and multiply
- arrays:
-
- MAT sum = a + b
- MAT diff = a - b
- MAT prod = a * b
-
- True BASIC follows the normal rules of matrix arithmetic.
-
-
- ADVANCED STRINGS
-
- True BASIC compares string values according to the ASCII code.
- This follows alphabetical order, except that all uppercase letters
- come before any lowercase letters.
-
- True BASIC concatenates strings with the ampersand (&) operator.
-
- True BASIC extracts substrings by giving the starting and endingpositions in the string: s$[start:end]. You can also change parts of
- an existing string by using a substring on the left side of a LET
- statement.
-
- True BASIC includes a number of built-in functions for operating
- with strings.
-
-
- Example Program
- ! Program to sort text in a list.
- !
- DIM name$(1) ! We'll redim later
-
- CALL Get_list ! Get list of items
-
- LET n = Ubound(name$) ! How many we have
-
- CALL Sort_list ! Sort the list
- MAT PRINT name$ ! Now print sorted list
-
- SUB Get_list
- PRINT "Enter items to be sorted"
- MAT INPUT name$(?) ! Redimension to input
- END SUB
-
- SUB Sort_list
- FOR i = n to 2 step -1
- FOR j = 1 to i-1
- IF name$(j) > name$(j+1) then CALL Swap
- NEXT j
- NEXT i
- END SUB
-
- SUB Swap
- LET temp$ = name$(j) ! Temporary variable
- LET name$(j) = name$(j+1)
- LET name$(j+1) = temp$
- END SUB
-
- END
-
-
- Example Program
- ! Haiku creator.
- !
- RANDOMIZE
- DECLARE DEF Pick$
- DIM article$(3), adjective$(15), noun$(12), verb$(15), prep$(4)
-
- MAT READ article$, adjective$
- MAT READ noun$, verb$, prep$
-
- LET line$ = Pick$(article$) & " " & Pick$(adjective$)
- LET line$ = line$ & ", " & Pick$(adjective$) & " "
- LET line$ = line$ & Pick$(noun$) & "--"
- PRINT line$
-
- LET line$ = Pick$(prep$) & " " & Pick$(article$) & " "
- LET line$ = line$ & Pick$(adjective$) & " " & Pick$(noun$)
- PRINT line$
-
- LET line$ = Pick$(article$) & " " & Pick$(noun$) & " "
- LET line$ = line$ & Pick$(verb$) & "."
- PRINT line$
-
- DATA the, a, this
-
- DATA distant, foggy, wet, black, snowy, spring, sighing
- DATA broken, hidden, cold, ruined, stiff, forgotten
- DATA drowsy, gleaming
-
- DATA mountain, garden, shack, cloud, bamboo, stone
- DATA wheelbarrow, pine, field, sparrow, pathway, pond
-
- DATA rings, appears, disappears, remains, dissolves, shows
- DATA huddles, rises up, is still, creaks, sways, is hidden
- DATA seems lost, forgets itself, sleeps
-
- DATA under, by, within, beneath
- END
- !
- ! Pick$. Choose an element of an array.
- !
- DEF Pick$(array$())
-
- LET n = Int(Rnd * Ubound(array$)) + 1
- LET Pick$ = array$(n)
-
- END DEF
-
-
- Example Program
- ! Check for palindromes.
- !
- DO
- PRINT "The phrase";
- LINE INPUT phrase$ ! No error-checking
-
- IF phrase$ = "" THEN STOP ! Stop on null string
-
- LET reversed$ = "" ! Initialize reversed$
- FOR i = Len(phrase$) to 1 step -1 ! Go thru backwards
- LET reversed$ = reversed$ & phrase$[i:i] ! Getting chars
- NEXT i
- PRINT "That's: "; reversed$
-
- IF reversed$ = phrase$ THEN ! Check reversed & original
- PRINT "It's a palindrome."
- ELSE
- PRINT "Not a palindrome."
- END IF
- PRINT
- LOOP
- END
-
- PICTURES
-
- You can think of pictures in True BASIC as the graphic equivalent
- of subroutines:
-
- PICTURE Name (parameter1, parameter2, ...)
- - - -
- - - -
- PLOT ...
- - - -
- - - -
- END PICTURE
-
- Pictures are called in DRAW statements.
-
- You can combine various picture transformations to change the size
- of a picture, rotate it, or move the picture to a different location.
- The available transformations are:
-
- Name Meaning
- Shift(a, b) Move(x,y)to(x+a,y+b)
- Scale(a, b) Change(x,y)to(x*a,y*b)
- Scale(a) Change(x,y)to(x*a,y*a)
- Rotate(a) Rotate(x,y) a radians counterclockwise around
- origin
- Shear(a) Lean verical lines forward (i.e., to the
- right) a radians
-
- Pictures may be internal or external, and may be included in
- libraries.
-
-
- Example Program
- ! A picture of a triangle.
- !
- PICTURE Triangle
- PLOT 0,0; 1,1; 1,0; 0,0 ! A triangle
- END PICTURE
-
- SET WINDOW 0, 16, 0, 10 ! Set the window
- DRAW Triangle ! Draw the triangle
- END
-
-
-
-
-
- Example Program
- ! Draws three houses using pictures
- !
- SET WINDOW 0, 10, 0, 10
- OPTION ANGLE degrees
- DRAW House with Scale(1) * Shift(7,6)
- DRAW House with Scale(1.5) * Shift(1.8,4)
- DRAW House with Rotate(45) * Scale(2,1.65) * Shift(6.2,1.8)
- END
-
- PICTURE House
- SET COLOR 3
- PLOT AREA: -1,-1; -1,1; 1,1; 1,-1 ! The house itself
-
- SET COLOR 1
- PLOT area: -1,1; 0,1.5; 1,1 ! Its roof
- PLOT area: -1,1; -1,1.4; -.8,1.4; -.8,1 ! and chimney
-
- SET COLOR 0
- PLOT area: -.15,-1; -.15,-.3; .15,-.3; .15,-1 ! A door
-
- DRAW Window with Shift(-.5,-.5) ! and 4 windows
- DRAW Window with Shift(-.5,.5)
- DRAW Window with Shift(.5,.5)
- DRAW Window WITH Shift(.5,-.5)
- END PICTURE
-
- PICTURE Window
- SET COLOR 0
- PLOT AREA: -.1,-.2; -.1,.2; .1,.2; .1,-.2 ! The window
- SET COLOR 1
- PLOT -.1,0; .1,0 ! and its sills
- PLOT 0,-.2; 0,.2
- END PICTURE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- AMIGA GRAPHICS
-
- Amiga Modes
-
- GRAPHICS Workbench screen, 640 X 200, 4 colours
- LOW2 320 X 200, 2 colours
- LOW4 320 X 200, 4 colours
- LOW 8 320 X 200, 8 colours
- LOW16 320 X 200, 16 colours
- LOW32 320 X 200, 32 colours
- LACELOW2 320 X 400, 2 colours, Interlaced
- LACELOW4 320 X 400, 4 colours, Interlaced
- LACELOW8 320 X 400, 8 colours, Interlaced
- LACELOW16 320 X 400, 16 colours, Interlaced
- LACELOW 32 320 X 400, 32 colours, Interlaced
- HIGH2 640 X 200, 2 colours
- HIGH4 640 X 200, 4 colours
- HIGH8 640 X 200, 8 colours
- HIGH16 640 X 200, 16 colours
- LACEHIGH2 640 X 400, 2 colours, Interlaced
- LACEHIGH4 640 X 400, 4 colours, Interlaced
- LACEHIGH8 640 X 400, 8 colours, Interlaced
- LACEHIGH16 640 X 400, 16 colours, Interlaced
-
- To switch to a new mode use the SET MODE command. For
- instance:
-
- set mode "high16"
-
- switches to HIGH16 mode. If you use a name that True BASIC
- doesn`t recognise, it uses mode GRAPHICS instead. (That is, it
- uses the full Workbench screen for output.)
- The Amiga clears the screen when you switch modes.
-
- The SET and ASK statements, for colours, reflect the current
- graphic mode.
- ASK MAX COLOR returns the numbers of foreground colours for
- the current mode.
- SET COLOR changes to a new foreground colour.
- ASK COLOR returns the current foreground colour.
- ASK COLOR MIX returns the actual color levels used by the Amiga.
-
-
-
- LIBRARIES
-
- Your True BASIC syetem disk includes several library files of
- functions and subroutines that supplement the True BASIC language.
- Four of the libraries contain mathematical functions; one contains
- subroutines for drawing graphs; and one contains subroutines for
- using menus.
- Your disk also contains a library, AmigaLib*, that lets you get at
- some of the Amiga`s special features. This library is written in
- True BASIC, C, and assembly language.
- These libraries are all in a directory named "Libs". You will need
- to add the directory name to your LIBRARY statement when you
- use these libraries - for example:
-
- library "Libs/AmigaLib*"
-
- MATHEMATICAL FUNCTIONS
- The four math libraries are:
-
- FnhLib Hyberbolic functions
- FntLib Trigonometric functions (in radians)
- FntdLib Trigonometric functions (in degrees)
- FnmLib Math functions
-
- Their file names and functions are listed below:
-
- Library File FnhLib
- Include file Functions Explanation
- Fnh Sinh(a) Hyperbolic sine of a
- Cosh(a) Hyperbolic cosine of a
- Tanh(a) Hyperbolic tangent of a
- Coth(a) Hyperbolic cotengent of a
- Sech(a) Hyberbolic secant of a
- Csch(a) Hyperbolic cosecant of a
- Asinh(a) Hyperbolic arcsine of a
- Acosh(a) Hyperbolic arccosine of a
- Atanh(a) Hyperbolic arctangent of a
- Acoth(a) Hyperbolic arccotangent of a
- Asech(a) Hyperbolic arcsecant of a
- Acsch(a) Hyperbolic arccosecant of a
-
- Library file FntLib
- Fnt Cot(a) Cotangent of a
- Sec(a) Secant of a
- Csc(a) Cosecant of a
- Asin(a) Arcsine of a
- Acos(a) Arccosine of a
- Acot(a) Arcotangent of a
- Asec(a) Arcsecant of a
- Acsc(a) Arccosecant of a
-
- Library file FntdLib
- Fntd Cot(a) Cotangent of a
- Sec(a) Secant of a
- Csc(a) Cosecant of a
- Asin(a) Arcsine of a
- Acos(a) Arccosine of a
- Acot(a) Arccotangent of a
- Asec(a) Arcsecant of a
- Acsc(a) Arccosecant of a
-
-
-
-
- Libary file FnmLib
- Fnm Logbase(x,b) Log of x to the base b
- Erf(x) Error function: Erf(x)=
- 2*Norm1(Sqr(2)*x)
- Normal(a,b) Area under the normal curve
- from a to b
- Norm1(x) Area under the normal curve
- from 0 to x
- Factrl(n) n factorial
- Binom(n,j) Binomial coefficient
- Binompr(n,j,p) Binomial distribution
- Poisson (m,j) Poisson distribution
-
- The "Include file" listed for each library file contains a LIBRARY
- statement with the appropriate file name, and DECLARE DEF
- statement(s) that declare the appropriate functions. File Fntd also
- contains an OPTION ANGLE DEGREES statement, so that functions
- in library file FntdLib expect all angles to be measured in degrees.
- To use one of the above libraries in you program, therefore, all
- you have to do is include the corresponding file. Move your
- insertion point to the first line in your program. Choose include
- from the Edit menu, select the name of the include file that
- corresponds to the library you want to use, and click the include
- button. For example to use Library FnhLib, include Fnh. The
- following statements will be added to your file:
-
- library "Libs/FnhLib"
- declare def Sinh, Cosh, Tanh, Coth, Sech, Csch
- declare def Asinh, Acosh, Atanh, Acoth, Asech, Acsch
-
- You can then use any of the twelve hyperbolic functions in your
- programs just as if they were part of the True BASIC language.
-
- GRAPHICS SUBROUTINES
- The GraphLib library contains several graphic subroutines. The
- following list gives the form of the CALL statement and an
- explanation of each subroutine.
-
- CALL Arc(x,y,r,a1,a2) Draws and arc of the circle with
- centre at (x,y) and radius r.
- The arc is from a1 to a2, where a1
- and a2 are angles in degress.
-
- CALL Axes Draws the X- and Y-axes of your
- current window.
-
- CALL Bars(data,n) Draws a bar graph of n numbers
- stored in the one-dimensional
- array data. Bars sets its own
- window.
-
-
-
- CALL Fplot(a,b) Draws a line graph of function F from a to b. You must define
- function F(x) as an external
- function. Fplot sets its own
- window.
-
- CALL Frame Draws a frame around your current
- window.
-
- CALL Polygon(x1,x2,y1,y2,n) Draws an n-sided polygon within a
- box defined by coordinates
- x1,x2,y1, and y2.
-
- CALL Ticks(a,b) Draws the X- and Y-axes of your
- current window, with tick marks a
- units apart on the X-axes and b
- units apart on the Y-axes.
-
- To use any of these subroutines in your program, just add the
- statement:
-
- library "Libs/GraphLib"
-
- at the beginning of your program.
-
-
- MENU SUBROUTINES
-
- Library MenuLib contains five subroutines for using "push button"
- menus. These menus, unlike the usual "pull down" menus, have all
- items visible on the screen at the same time. The items look like
- OK and Cancel buttons.
-
- MenuLib lets you choose the placement of the menu on your
- screen, the number of items in the menu, and the button labels.
- Menu items must be selected by clicking one of the buttons; the
- subroutines check that the responses are legal. The menus are
- displayed in a seperate window, #9. Prompts and choices are
- diplayed in whatever window your program has opened (the
- "working window").
-
- The five menu subroutines are:
-
- Menu_set Opens the menu window, #9, and sets the
- parameters for the other menu subroutines.
-
- Menu_all Displays the menu and prompt, gets a choice and
- diplays it, clears the menu window, and returns to
- the working window.
-
- Menu Displays the menu and gets a choice.
-
- Menu_show Displays the menu.
- Menu_ask Gets a choice.
- Their parameters are explained in detail below. To use any of thesubroutines, add the statement:
-
- libary "Libs/MenuLib"
-
- to your program, before any statements that CALL the subroutines.
- You should first call the subroutine Menu_set, which opens the
- menu window, #9, and sets the parameters of menu placement,
- number of items, and size of items for the other routines. After
- calling Menu_set, you can use any of the other four to display the
- menu and process the choice, but Menu_all is the most general.
- Most applications can be handled by using only Menu_set and
- Menu_all.
-
- Menu_set requires a CALL statement of the form:
-
- CALL Menu_set(where$, c$, maxent, maxlen, menu$, $9)
-
- The parameters have the following meanings:
-
- where$ Placement of menu. where$ may be "top", "bottom",
- "left", or "right", in upper of lowercase letters.
-
- c$ Colour for the menu window.
-
- maxent Maximeum number of entries in any menu. maxent
- cannot be greater than ten.
-
- maxlen Maximum length of a menu item, maxlen cannot be
- greater then ten.
-
- menu$ menu$ is a packed variable that is used by all the
- other menu subroutines. You should not try to chanhe
- menu$.
-
- #9 Window #9 is where the menu will be displayed.
-
- The CALL statement for subroutine Menu_all has the form:
-
- CALL Menu_all (M$, m, prompt$, ans, menu$, #n, #9)
-
- The parameters are:
-
- M$ A one dimensional string array containing the menu
- items.
-
- m The number of menu items in thelist M$. m cannot be
- greater than the value of maxent given in the call to
- Menu_set.
-
- prompt$ The prompt that will be displayed in the working
- window.
-
- ans The menu item chosen (a number from 1 to m)
- menu$ the packed string created by Menu_set. You should not try to use menu$.
-
- #n The working window opened in your program. n must be
- a numeric constant between 1 and 1000.
-
- #9 The menu window opened by Menu_set.
-
-
- The Amiga Library
-
- Your disk also contains AmigaLib*, a special library of Amiga
- subroutines. This library is written in a mixture of True BASIC, C,
- and assembly language. We`ve combined the results into a single,
- compiled library, but your disk also contains the seperate source
- files.
-
- CALL Say(speech$)
- Speaks the given speech$ aloud, using the Amiga`s voice
- synthesizer
-
- CALL Cycle(color$,inc)
- Cycles the colour mixes for the active colours on the
- screen. The string color$ contains a strangely packed string
- representing the colours to use. The Rainbow$ function, below,
- gives a rainbow colour cycle. The expression inc gives the
- "step" to use when cycling through the colours: +1 cycles one
- way, -1 cycles the other, and so forth.
-
- LET color$=Rainbow$
- Rainbow$ gives a color$ string suitable for use with the
- cycle subroutine. It contains the colours of the rainbow.
- Rainbow$ is a True BASIC function: see its source code for a
- description of the format of color$ string.
-
- CALL CLI(command$)
- CLI issues a CLI command command$. Output produced by
- this command is normally discarded. To see the output and
- to execute commands interactively, give the null string as a
- command. This will open a new, independant CLI window. This
- subroutine causes an exception if the CLI can`t be used - for
- instance, if the Amiga is running low on memory or if the
- command program RUN isn`t present in the C: logical device.
-
- LET filename$=GetFile$(x,y,type$,button$)
- GetFile$ presents an Open box on the screen, lets the user
- select a file name, and returns that file name. As usual,
- the user can switch disks and directories while using the
- Open box. If the user clicks Cancel, GetFile$ returns a null
- string. The x and y coordinates give the pixel location of the
- top left corner of the box. The Type$ is included only for
- compatability with GetFile$ on other brands of computers, it`s
- ignored on the Amiga. The button$ text replaces "Open" in
- the Box`s button. It can be up to 7 characters long.
-
- To use any of these routines, add a library statement to the start
- of your program; add the DECLARE DEF statement only if you
- want to use Rainbow$ or GetFile$ funtions:
-
- library "Libs/AmigaLib*"
- declare def Rainbow$, GetFile$
-
- The program spirograph shows how to use the Cycle and Rainbow$
- routines. The program Speackup shows how to use the Say
- subroutine. Both programs are in the Demos directory.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- TRUE BASIC AMIGA COMMAND LIST
-
- Syntax for commands:
- block may ba a line number, range of lines, routine name, orselected line(s).
-
- filename may be any valid filename.
-
- text may be any word or number in your program, or any
- characters enclosed in "quotes".
-
- Commands
- Type on Command line in Command window.
-
- BREAK
- BREAK block
-
- CHANGE old,new where old and new are text
- COMPILE
- CONTINUE
- COPY from,to where from and to are blocks
-
- DELETE block
- DO filename
- DO FORMAT
- DO NUM
- DO RENUM
- DO UNNUM
-
- EDIT
- EDIT block
-
- FILES
-
- INCLUDE filename
-
- KEEP block
- KEY
- KEY FROM filename
- KEY TO filename
-
- LIST
- LIST block
- LOCATE text
-
- MARK
- MARK block
- MOVE block1,block2
-
- NEW
-
- OLD filename
-
- REPLACE filename
- RUN
-
- SAVE filename
-
- TO block
- TRY old,new where old and new are text
-
- UNSAVE filename
-
- Mathematical functions
-
- Abs(x)
- Divide(x,y,q,r)
- Eps(x)
- Exp(x)
- Int(x)
- Log(x)
- Log2(x)
- Log10(x)
- Max(x,y)
- Maxnum
- Min(x,y)
- Mod(x,y)
- Remainder(x,y)
- Rnd
- Round(x)
- Round(x,n)
- Sgn(x)
- Sqr(x)
- Truncate(x,n)
-
- Trigonometric functions
-
- Angle(x,y)
- Atn(x)
- Cos(x)
- Deg(x)
- Pi
- Rad(x)
- Sin(x)
- Tan(x)
-
- String functions
-
- Chr$(n)
- Len(a$)
- Lcase$(a$)
- Ltrim$(a$)
- Ord(a$)
- Pos(a$,b$)
- Repeat$(a$,n)
- Rtrim$(a$)
- Str$(n)
- Trim$(a$)
- Ucase$(a$)
- Using$(fmt$,a)
- Val(a$)
-
- Date and time functions
-
- Date
- Time
- Date$
- Time$
-
- Ask statements
-
- BACK var #n: ACCESS var$
- COLOR var #n: FILESIZE var
- COLOR MIX (color) r,g,b
- CURSOR var$ #n: MARGIN var
- CURSOR line,column #n: NAME var$
- FREE MEMORY var #n: ORIGANIZATION var$
- MARGIN var #n: POINTER var$
- MAX COLOR var #n: RECORD var
- MAX CURSOR line,column #n: RECSIZE var
- MODE var$ #n: ZONEWIDTH var
- SCREEN x1,x2,y1,y2
- WINDOW x1,x2,y1,y2
- ZONEWIDTH var
-
-
- BOX AREA left,right,bottom,top
- BOX CIRCLE left,right,bottom,top
- BOX CLEAR left,right,bottom,top
- BOX ELLIPSE left,right,bottom,top
- BOX KEEP left,right,bottom top IN var$
- BOX LINES left,right,bottom,top
- BOX SHOW var$ AT left,bottom
- BOX SHOW var$ AT left,bottom USING expr
-
- CALL subr (expr1,expr2,...)
-
- CAUSE ERROR expr
- CAUSE ERROR expr,expr$
-
- CHAIN expr$
- CHAIN expr$,RETURN
- CHAIN expr$ WITH (arg$)
- CHAIN expr$ WITH (arg$), RETURN
-
- CLEAR
-
- CLOSE #expr
-
- DATA item1,item2,...
-
- DECLARE DEF func1,func2,...
- DEF func(var1,var2,...) = exp
-
- DEF func(var1,var2,...)
- ...
- LET func=expr
- ...
- END DEF
-
- DIM array(bound,bound,...),...
- DIM array(low TO high,low TO high,...),...
-
- DO WHILE condition
- ... WHILE condition
- ... UNTIL condition
- LOOP
-
- DRAW picture
- DRAW picture WITH transform*transform* ...
-
- END
-
- ERASE #expr
-
- EXIT DEF
- EXIT DO
- EXIT FOR
- EXIT HANDLER
- EXIT SUB
-
- EXTERNAL
-
- FLOOD x,y
-
- FOR var = first TO last STEP size
- ...
- ...
- NEXT var
-
- GET KEY var
- GET MOUSE x,y,state
- GET POINT x,y
-
- GOSUB line-number
- GOTO line-number
-
- IF condition THEN statement
- IF condition THEN statement1 ELSE statement2
- IF condition THEN
- ...
- ...
- END IF
- IF condition THEN
- ...
- ...
- ELSE IF condition THEN
- ...
- ...
- ELSE
- ...
- ...
- END IF
- INPUT var1,var2,...
- INPUT PROMPT expr$,var1,var2,...
- LINE INPUT var1$,var2$,...
- LINE INPUT PROMPT expr$,var1$,var2$,...
- INPUT statements can be used with files. Add a channel
- number, such as:
- INPUT #expr:a$
- LINE INPUT #expr,PROMPT expr$,var1$,var2$,...
-
- LET var1,var2,...=expr
- LET var1$(start:end)=expr$
-
- LIBRARY "filename","filename",...
-
- MAT array=(expr)
- MAT array=array1+array2
- MAT array=array1-array2
- MAT array=arrat1*array2
- MAT array-Inv(array1)
- MAT array=Trn(array1)
-
- MAT PLOT AREA: array
- MAT PLOT LINES: array
- MAT PLOT POINTS: array
- MAT may also precede any INPUT,PRINT,READ, or WRITE
- statement. If so, the statement reads/writes arrays rather
- then ordinary variables.
-
- ON expr GOSUB line-number,line-number,...
- ON expr GOSUB line-number,line-number,...ELSE line-number
- ON expr GOTO line-number,line-number,...
- ON expr GOTO line-number,line-number,...ELSE line-number
-
- OPEN #expr:NAME expr$, ACCESS accmode$
- , CREATE crtmode$
- , ORGANIZATION orgmode$
- , RECSIZE recsize
- accmode$ can be "INPUT", "OUTPUT", "OUTIN"
- crtmode$ can be "NEW", "OLD", "NEWOLD"
- ormode$ can be "TEXT", "RECORD", "BYTE"
-
- OPEN #expr:PRINTER
- OPEN #expr:SCREEN left,right,bottom,top
-
- OPTION ANGLE DEGREES
- OPTION ANGLE RADIANS
- OPTION BASE constant
-
- PAUSE expr
-
- PICTURE Pic(var1,var2,...)
- ...
- ...
- END PICTURE
- PLAY music$
-
- PLOT x1,y1;x2,y2;...
- PLOT AREA:x1,y1;x2,y2;...
- PLOT LINES:x1,y1;x2,y2;...
- PLOT POINTS:x1,y1;x2,y2;...
- PLOT TEXT,AT x1,y1:expr$
-
- PRINT expr1,expr2,...
- PRINT expr1;expr2;...
- PRINT USING format$:expr1,expr2,...
-
- PROGRAM name
- PROGRAM name(var$)
-
- RANDOMIZE
-
- READ var1,var2,...
- READ #expr:var1,var2,...
- READ #expr,BYTES expr:var1,var2,...
-
- REM
-
- RESET
-
- RESTORE
-
- RETURN
-
- SELECT CASE expr test may be
- CASE test1,test2,...
- ... constant
- ... low TO high
- CASE test3,test4,... IS op constant
- ...
- ... op can be <,=,<>, etc
- CASE ELSE
- ...
- ...
- END SELECT
-
- Set Statements
-
- BACK expr #n:MARGIN expr
- COLOR expr #n:POINTER BEGIN
- COLOR MIX (color) r,g,b
- CURSOR expr$ #n:POINTER END
- CURSOR line,column #n:POINTER NEXT
- MARGIN expr #n:POINTER SAME
- MODE name$ #n:RECORD expr
- WINDOW x1,x2,y1,y2 #n:RECSIZE expr
- ZONEWIDTH expr #n:ZONEWIDTH expr
-
- SOUND freq,time
- STOP
-
- SUB subr(var1,var2,...)
- ...
- ...
- END SUB
-
- UNSAVE expr$
-
- WHEN ERROR IN
- ...
- ...
- USE
- ...
- ...
- END WHEN
-
- WINDOW #expr
-
- WRITE #expr:expr1,expr2,...
-
- Formatting characters for PRINT USING statement and Using$
- function
-
- + print number with leading "+" or "-"
- - print number with leading space or "-"
- $ print number with leading dollar sign
- * print leading zeros as "*"
- % print leading zeros as "0"
- # print leading zeros as spaces
- , insert comma here if appropriate
- . align decimal point here
- ^ exponent field
- < left justify string
- > right justift string
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ERROR MESSAGES
-
- Argument types don`t match.
- Your`e calling a routine with some argumanets, but earlier in your
- program you defined or called the same routine with different
- arguments. Either you`re giving a different number of arguments in
- the calls, or their types are different - you`re passing strings
- instead of numbers, or vice versa. Check this call against
- preceding calls, and against the routine`s definition.
-
- Bad FIND item; try using quotes.
- When you`re trying to find a string which contains a comma or
- double quote marks, you must enclose the entire string with double
- quote marks. (These rules are the same as for strings in INPUT
- replies or DATA statements.)
-
- Badly formed USING string. (8201)
- The format string in your Using$ function or PRINT USING
- statement is incorrect. One of the format items doesn`t follow
- True BASIC`s rules.
-
- Badly formed input line. (8105)
- The reply to an INPUT statement (either from a file or from the
- keyboard) is badly formed. Most lekely you have not properly
- matched up opening and closing quote marks.
-
- Can`t change that key.
- True BASIC does not let you change the meanings of any of the
- normal, printing characters.
-
- Can`t continue.
- You`ve just given a CONTINUE command, to resume running a
- suspended program. However, True BASIC cannot continue the
- program. There are several possible reasons. You cannot continue
- a program that you haven`t yet started running, or one which
- you`ve just changed. You cannot continue a program which stopped
- because an error occured. And you cannot continue a suspended
- program afeter using a DO command. If you are trying to debug a
- program which stopped because of an error, try using the BREAK
- command to insert breakpoints before the erroneous line, and then
- run the program again.
-
- Can`t copy region itself.
- The True BASIC editor does not let you copy a region into itself.
- For instance, you may not make a copy of some subroutine within
- that subroutine. If you really want to, you can put a copy of the
- region somewhere else, and then move this copy into the original
- region.
-
- Can`t do graphics on this computer. (11000)
- Your computer cannot draw graphics. (Not for Amiga)
-
- Can`t edit compiled program,
- Your program is compiled, and so cannot be changed.
- Can`t erase file not opened as OUTIN. (7301)
- You may not use the ERASE statement on a file, unless the file
- has been opePLAY music$
-
- PLOT x1,y1;x2,y2;...
- PLOT AREA:x1,y1;x2,y2;...
- PLOT LINES:x1,y1;x2,y2;...
- PLOT POINTS:x1,y1;x2,y2;...
- PLOT TEXT,AT x1,y1:expr$
-
- PRINT expr1,expr2,...
- PRINT expr1;expr2;...
- PRINT USING format$:expr1,expr2,...
-
- PROGRAM name
- PROGRAM name(var$)
-
- RANDOMIZE
-
- READ var1,var2,...
- READ #expr:var1,var2,...
- READ #expr,BYTES expr:var1,var2,...
-
- REM
-
- RESET
-
- RESTORE
-
- RETURN
-
- SELECT CASE expr test may be
- CASE test1,test2,...
- ... constant
- ... low TO high
- CASE test3,test4,... IS op constant
- ...
- ... op can be <,=,<>, etc
- CASE ELSE
- ...
- ...
- END SELECT
-
- Set Statements
-
- BACK expr #n:MARGIN expr
- COLOR expr #n:POINTER BEGIN
- COLOR MIX (color) r,g,b
- CURSOR expr$ #n:POINTER END
- CURSOR line,column #n:POINTER NEXT
- MARGIN expr #n:POINTER SAME
- MODE name$ #n:RECORD expr
- WINDOW x1,x2,y1,y2 #n:RECSIZE expr
- ZONEWIDTH expr #n:ZONEWIDTH expr
- SOUND freq,time
- STOP
-
- SUB subr(var1,var2,...)
- ...
- ...
- END SUB
-
- UNSAVE expr$
-
- WHEN ERROR IN
- ...
- ...
- USE
- ...
- ...
- END WHEN
-
- WINDOW #expr
-
- WRITE #expr:expr1,expr2,...
-
- Formatting characters for PRINT USING statement and Using$
- function
-
- + print number with leading "+" or "-"
- - print number with leading space or "-"
- $ print number with leading dollar sign
- * print leading zeros as "*"
- % print leading zeros as "0"
- # print leading zeros as spaces
- , insert comma here if appropriate
- . align decimal point here
- ^ exponent field
- < left justify string
- > right justift string
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ERROR MESSAGES
-
- Argument types don`t match.
- Your`e calling a routine with some argumanets, but earlier in your
- program you defined or called the same routine with different
- arguments. Either you`re giving a different number of arguments in
- the calls, or their types are different - you`re passing strings
- instead of numbers, or vice versa. Check this call against
- preceding calls, and against the routine`s definition.
-
- Bad FIND item; try using quotes.
- When you`re trying to find a string which contains a comma or
- double quote marks, you must enclose the entire string with double
- quote marks. (These rules are the same as for strings in INPUT
- replies or DATA statements.)
-
- Badly formed USING string. (8201)
- The format string in your Using$ function or PRINT USING
- statement is incorrect. One of the format items doesn`t follow
- True BASIC`s rules.
-
- Badly formed input line. (8105)
- The reply to an INPUT statement (either from a file or from the
- keyboard) is badly formed. Most lekely you have not properly
- matched up opening and closing quote marks.
-
- Can`t change that key.
- True BASIC does not let you change the meanings of any of the
- normal, printing characters.
-
- Can`t continue.
- You`ve just given a CONTINUE command, to resume running a
- suspended program. However, True BASIC cannot continue the
- program. There are several possible reasons. You cannot continue
- a program that you haven`t yet started running, or one which
- you`ve just changed. You cannot continue a program which stopped
- because an error occured. And you cannot continue a suspended
- program afeter using a DO command. If you are trying to debug a
- program which stopped because of an error, try using the BREAK
- command to insert breakpoints before the erroneous line, and then
- run the program again.
-
- Can`t copy region itself.
- The True BASIC editor does not let you copy a region into itself.
- For instance, you may not make uare matrix, since the determinant
- is mathematically defined only for such matrices.
-
- Disk full. (9006)
- You are writing output to a file, and the disk has become full.
-
- Diskette removed, or wrong diskette. (9005)
- You had opened a file, but while True BASIC was using it, you
- removed the disk and inserted another one. Don`t switch diskswhile they`re in use!
-
- Division by zero. (3001)
- One of your expressions tried to divide some quantity by zero. If
- you want to substitute the largest possible number and continue
- (without an error), enclose the expression in a WHEN statement:
- when error in
- let x=(1+2+3)/0
- use
- let x=Maxnum
- end when
- Maxnum is a True BASIC function which gives the largest possible
- number available on your computer.
-
- Doesn`t belong here.
- The cursor points to some word in your program which doesn`t
- make sense.
-
- Ending doesn`t match beginning.
- You are using a structured statement, such as a FOR-NEXT or IF-
- THEN-ELSE, and the ending statement doesn`t properly match the
- beginning of the structure. Most likely you have forgotten the
- ending statement for some structure within this one. Or you may
- have begun a FOR loop using one index variable, but used another
- variable on the NEXT statement.
-
- Error in PLAY string. (4501)
- The string given in your PLAY statement doesn`t follow True
- BASIC rules.
-
- Expected "thing"
- The cursor points to a spot where True BASIC expected some word
- or punctuation, but found something else.
-
- Expected relational operator.
- The cursor points to a spot where you must put a relational
- operator, such as "=" or "<". (Note that True BASIC does not allow
- statements like "IF a THEN ...", as do some other BASICs. Change
- such statements to "IF a<>0 THEN...".)
-
- File already exists. (9004)
- You are trying to create a new file, but it already exists. Check
- to make sure you have given the correct filename. If you want to
- overwrite an existing file, change the CREATE NEW in the open
- statement to CREATE NEWOLD. Or use the REPLACE command
- instead of SAVE.
-
- File is read or write protected. (9001)
- You are trying to read or write a file but your operating system
- has write or read-protected this file.
-
- File pointer out of bounds. (7252)
- You are trying to use the RESET or SET POINTER or SET RECORD
- statement to change a file`s pointer. However the position you`vegiven is either less than 1, or past the end of the file.
-
- File`es record size doesn`t match open OPEN RECSIZE. (7103)
- Each record file has its RECSIZE built into it. The RECSIZE of
- the file you`re trying to open doesn`t match the RECSIZE given in
- your OPEN statement.
-
- IDN must make a square matrix. (6004)
- Identity matrices must be square. Therefore when you use the
- Idn(x,y) function, you must make sure that x=y.
-
- Illegal array bounds for name in routine
- You`ve defined an array where the upper bound is less than the
- lower bound.
-
- Illegal channel.
- You`ve written a SET or ASK statement that requires a channel
- number, but doesn`t have one. Or you`ve added a channel number
- to a SET or ASK statement that doesn`t allow one.
-
- Illegal data.
- Your DATA statement is not properly written.
-
- Illegal exit.
- You`ve written an EXIT DO statement outside of any DO-LOOPS,
- or an EXIT-FOR outside of any FOR loop, etc. Or you have
- written unknown kind of EXIT statement.
-
- Illegal expression.
- The cursor points somewhere within an expression that doesn`t
- follow True BASIC`s rules.
-
- Illegal keyword.
- The cursor points to a word that doesn`t make sense in that
- location.
-
- Illegal number.
- The cursor points to a spot where a number is required, but you`ve
- given something else.
-
- Illegal option.
- Make sure you`ve spellled ANGLE,BASE,DEGREES,and RADIANS
- properly.
-
- Illegal parameter.
- You`ve written a SUB, DEF, or PICTURE statement, defining a
- routine. Something is wrong with one of the paramaters in the
- parameter list.
-
- Illegal statement.
- Each statement must beging with a True BASIC keyword, such as
- LET or SELECT.
-
-
- Improper NUM string. (4020)
- The string you`ve given to the NUM fuction doesn`t represent an
- IEEE 8-byte floating point number.
- Improper ORD string. (4003)
- The Ord function requires either a one-character string, or a string
- giving the official name of an ASCII character. No leading or
- trailing spaces are allowed.
-
- Input item bigger then RECSIZE. (8302)
- This message is only given for damaged record files.
-
- INV needs a square matrix. (6003)
- Matrix inversion is defined only for square matrices.
-
- LBOUND out of range. (4008)
- You are using a call such as Lbound(A,3) and the array A doesn`t
- have three dimensions.
-
- LOG of number <=0. (3004)
- Logarithms are only defined for positive numbers.
-
- MARGIN less than zonewidth. (4006)
- Your SET MARGIN statement is trying to set a margin less then
- the zonewidth.
-
- Mismatched array sizes. (6001)
- You`re using a MAT statement which requires arrays of the same
- size, but the arrays are different sizes.
-
- Missing end statement.
- All True BASIC programs must contain END statements.
-
- MOD and REMAINDER can`t have 0 as 2nd argument. (3006)
- The Mod and Remainder functions do not allow zero as their
- second argument, since this is equivalent to dividing by zero.
-
- Must be a function name.
- You`ve written a DEF or FUNCTION statement, but no proper
- function name follows the DEF or FUNCTION.
-
- Must be a number.
- Use a number, not an expression.
-
- Must be a picture name.
- Your DRAW statement names something other than a picture.
-
- Must be a string constant.
- Use a constant, not an expression.
-
- Must be a subroutine name.
- The CALL statement can only be used to call subroutines.
-
- Must be a variable.
- You`ve used an expression, or a routine name, in a place whereonly a variable is permitted.
-
-
- Must be an array.
- You must give an array variable.
-
- Must be a byte file for READ BYTES. (7351)
- You`re tring to use a READ BYTES statement on a text or record
- file.
-
- Must be byte file or empty for SET RECSIZE. (7251)
- SET RECSIZE can only be used or byte files, or on empty record
- files.
-
- Must be record or byte file for SET RECORD. (7202)
- SET RECORD cannot be used on text files. You may reset a text
- file`s pointer only to the very beginning or very end of the file.
-
- Must be record or byte file. (8502)
- You`re using the READ or WRITE statement on a text file, or on a
- window.
-
- Must be a text file. (8501)
- You`re using an INPUT or PRINT statement on a record file or a
- byte file.
-
- Must SET RECSIZE before WRITE. (8304)
- You cannot write to an empty record file without somehow first
- indicating the file`s record size. You may either execute a SET
- RECSIZE statement before the first WRITE statement, or you may
- specify the file`s record size in the OPEN statement.
-
- Name can`t be redefined.
- You can`t use the same name for two different things.
-
- Negative number to non-intergral power. (3002)
- You`re trying to compute n^x but n is negative and x is not an
- integer.
-
- No CASE selected, but no CASE ELSE. (10004)
- You have executed a SELECT CASE statement, but no CASE test
- has succeeded. Since you didn`t have a CASE ELSE block to catch
- this problem, True BASIC prints this error message.
-
- No GET MOUSE on this computer. (8700)
- You computer does not support a mouse. (Not Amiga).
-
- No main program.
- Your current file contains only functions, pictures, and/or
- subroutines - but no main program.
-
- No saved copy - still want to compile?
- Compile requester.
-
- No such color. (11008)
- You`re using the SET COLOR statement with some colour name that
- True BASIC doesn`t recognize.
- No such file. (9003)
- You`re trying to use a file which doesn`t exist.
-
- No such function or subroutine.
- You`ve named a function, subroutine, or picture in a command, but
- this routine doesn`t exist.
-
- No such line numbers.
- You`ve given a range of line numbers in a command, but no lines
- have those numbers.
-
- No USING item for ouput. (8202)
- The format string in your Using$ function or PRINT USING
- statement has no formatting items in it.
-
- Not found.
- You`ve used the FIND key to find some word or phrase, but it
- wasn`t found.
-
- ON index out of range, no ELSE given. (10001)
- You`ve used an ON GOTO or ON GOSUB statement, and the number
- on which you`re branching is out of range.
-
- Out of memory. (5000)
- Out of memory - get more add-on memory!
-
- Ouput item bigger than RECSIZE. (8301)
- You`re trying to write an item to a record file, but it doesn`t fir
- within the record size established for that file.
-
- Overflow. (1000)
- You`ve computed a number bigger than the one your computer can
- handle.
-
- Please say what lines you mean.
- Mark the lines.
-
- Please try "CHANGE old,new".
- Give both old and new phrases.
-
- Please try "DO filename".
- You must give a file name when using the DO command.
-
- Please try "INCLUDE filename".
- You must give a file name when using the INCLUDE command.
-
- Please try "KEY" or "KEY FROM file" or "KEY TO file".
- You must give a file name.
-
- Please try "LOCATE item".
- You must give the phrase to be located.
- Please try "OLD filename".
- You must give a file name.
- Please try "SAVE filename" or "REPLACE filename".
- You must give a filename.
-
- Please try "UNSAVE filename@.
- You must give a filename.
-
- Please type line numbers as 100 or 100-150.
- True BASIC can`t understand a command such as DELETE with the
- line numbers you have given.
-
- Program stopped.
- You pressed the STOP key.
-
- REPEAT$ count <0. (4010)
- You`re using the Repeat$(a$,n) function, but n is less than zero.
-
- Reading past end of data. (8001)
- You`ve executed a READ statement, but have run out of DATA
- items to read.
-
- Reading past end of file. (8011)
- You`re trying to read more than exists in the file.
-
- RETURN without GOSUB. (10002)
- You`ve just executed a RETURN statement, but there has been no
- corresponding GOSUB instruction.
-
- Screen bounds must be 0 to 1. (11003)
- The bounds given on an OPEN SCREEN statement must lie in the
- range from 0 to 1, inclusive. No matter how big your screen is,
- the left and bottom edges are defined to be 0; the rifht and top
- edges are defined to be 1.
-
- Screen minimum >+ maximum. (11002)
- Incorrect OPEN SCREEN values.
-
- SIZE index out of range. (4004)
- You`re trying to take SIZE(A,3) for instance, when the array A has
- fewer than 3 dimensions.
-
- SQR of negative number. (3005)
- You are trying to take the square root of a negative number.
-
- Statement outside of program.
- Statement is outside your main program, but is not included within
- any external routine.
-
- String given instead of number. (8103)
- You`ve executed an INPUT statement which is trying to input a
- number. However the reply given isn`t a number.
-
-
- String too long. (1051)
- You`ve tried to create a string longer than 1,048,575 characters.
-
- Subscript out of bounds. (2001)
- You`ve given an array subscript that lies outside the array`s
- bounds.
-
- TAB column not between 1 and margin. (4005)
- You`ve used the TAB function in a PRINT statement, but its
- argument doesn`t lie between 1 and the current margin.
-
- The BYE command is just "BYE".
- When you want to leave True BASIC just type BYE.
-
- This must first appear in a DIM or DECLARE DEF.
- True BASIC doesn`t know if it`s an array or a function.
-
- Too few input items. (8002)
- You`ve executed an INPUT statement, and the input reply doesn`t
- contain as may items as requested.
-
- Too many channels open. (7102)
- You have tried to open more than 10 channels.
-
- Too many input items. (8003)
- You`ve executed an input statement and the input reply line
- contains more items than requested.
-
- Trouble using disk or printer. (9002)
- Printer or disk problem.
-
- Type is wrong for name in routine
- You`ve tried calling a routine named routine within another routine
- named routine. However you got the arguments wrong in this call
- - they don`t match the parameter list.
-
- UBOUND out of range. (4009)
- You`ve tried calling something like Ubound(a,3), where a is an
- array with less than 3 dimensions.
-
- Undefined routine name in routine
- The routine named routine has tried to use a function, subroutine,
- or picture called name. But this is nowhere defined.
-
- Unknown OPEN option. (7101)
- Option doen`t exist.
-
- VAL string isn`t a proper number. (4001)
- You`ve called the Val function, but the string you gave doesn`t
- properly represent a number.
- What? (Please type HELP.)
- Unknown command.
-
-
- Window minimum=maximum (11001)
- You`ve executed a SET WINDOW statement which sets the vertical
- or horizontal window maximum equal to the minimum.
- Wrong number of arguments.
- You`re calling a function, subroutine, or picture, but specifying the
- wrong number of arguments.
-
- Wrong number of dimensions.
- You`re trying to use an array, but have given the wrong number of
- dimensions.
-
- Wrong type.
- You`re tring to use a string where a number is needed, or a
- number where a string is needed.
-
- Wrong type of file. (7104)
- Wrong type of file for OPEN statement.
-
- You have two routines called name in routine.
- In the routine named routine, you`ve defined two different routines
- called name.
-
- Zero to negative power. (3003)
- You`re trying to compute 0^n, where n<0.
-
- ZONEWIDTH out of range. (4007)
- You`ve executed a SET ZONEWIDTH statement, trying to set the
- zonewidth less than 1, or greater than the margin.
-
-
-
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
-
-
- Printed by COL
- 1 March 1988
-
- HAVE FUN!!!
-
-